package com.switz.agendacita.persistence;

import java.util.List;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.stereotype.Repository;

import com.switz.agendacita.dto.TiposEmpresa;
import com.switz.agendacita.dto.Usuario;
import com.switz.agendacita.persistence.iface.TipoEmpresaDao;

@Repository
public class TipoEmpresaDaoImpl extends JdbcDaoSupport implements TipoEmpresaDao {
	
	@Autowired
    public TipoEmpresaDaoImpl(DataSource dataSource) {

        setDataSource(dataSource);
    }

	@Override
	public List getTiposEmpresa() {
		String query= "SELECT * FROM tiposempresa";
		
		List personal = getJdbcTemplate().query(query, new Object[]{},
                ParameterizedBeanPropertyRowMapper.newInstance(TiposEmpresa.class));
        return personal;	
		
	}

}
